<?php
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');

$items = array();
$items["setup"][] = array("title"   => "Leagues",         "link" => "index2.php?option=com_leagueman&act=leagues",     "image" => "../includes/js/ThemeOffice/module.png");
$items["setup"][] = array("title"   => "Seasons",         "link" => "index2.php?option=com_leagueman&act=seasons",     "image" => "../includes/js/ThemeOffice/edit.png");
$items["setup"][] = array("title"   => "Positions",       "link" => "index2.php?option=com_leagueman&act=positions",   "image" => "../includes/js/ThemeOffice/users.png");
$items["setup"][] = array("title"   => "Eventtypes",      "link" => "index2.php?option=com_leagueman&act=eventtypes",  "image" => "../includes/js/ThemeOffice/component.png");

$items["general"][] = array("title" => "Clubmanager",     "link" => "index2.php?option=com_leagueman&act=clubs",       "image" => "../includes/js/ThemeOffice/users.png");
$items["general"][] = array("title" => "Teammanager",    "link" => "index2.php?option=com_leagueman&act=teams",       "image" => "../includes/js/ThemeOffice/edit.png");
$items["general"][] = array("title" => "Playermanager",   "link" => "index2.php?option=com_leagueman&act=players",     "image" => "../includes/js/ThemeOffice/users.png");
$items["general"][] = array("title" => "Projectlist",     "link" => "index2.php?option=com_leagueman",                 "image" => "../includes/js/ThemeOffice/module.png");

$items["project"][] = array("title" => "Manage Teams",    "link" => "index2.php?option=com_leagueman&act=teammap",     "image" => "../includes/js/ThemeOffice/db.png");
$items["project"][] = array("title" => "Manage Rounds",   "link" => "index2.php?option=com_leagueman&act=rounds",      "image" => "../includes/js/ThemeOffice/component.png");
$items["project"][] = array("title" => "Matcheditor",     "link" => "index2.php?option=com_leagueman&act=matrix",      "image" => "../includes/js/ThemeOffice/mainmenu.png");
$items["project"][] = array("title" => "Manage Results",  "link" => "index2.php?option=com_leagueman&act=matches",     "image" => "../includes/js/ThemeOffice/edit.png");
$items["project"][] = array("title" => "Leaguetable",     "link" => "index2.php?option=com_leagueman&act=leaguetable", "image" => "../includes/js/ThemeOffice/content.png");

$items["player"][] = array("title" => "Player", "link" => "index2.php?option=com_leagueman&act=playermap",             "image" => "../includes/js/ThemeOffice/db.png");

ob_start();
?>
<table width="100%" class="adminform">
    <tr>
        <th>General Data</th>
    </tr>
    <?php foreach ($items["general"] AS $item) : ?>
        <tr class="row0">
            <td>
                <img src="<?php echo $item["image"]; ?>" />&nbsp;
                <a href="<?php echo $item["link"]; ?>"><b><?php echo $item["title"]; ?></b></a>
            </td>
        </tr>
    <?php endforeach ?>
    </table>
    <br/>

<?php if (isset($this->project) && $this->project instanceof LM_Table_Project): ?>
    <table width="100%" class="adminform">
        <tr>
            <th><?php echo $this->project->getName(); ?></th>
        </tr>
        <?php foreach ($items["project"] AS $item) : ?>
        <tr class="row0">
            <td>
                <img src="<?php echo $item["image"]; ?>" />&nbsp;
                <a href="<?php echo $item["link"]; ?>"><b><?php echo $item["title"]; ?></b></a>
            </td>
        </tr>
        <?php endforeach ?>
    </table>
    <br />
<?php endif ?>

<?php if (isset($this->team) && $this->team instanceof LM_Table_Team): ?>
    <table width="100%" class="adminform">
        <tr>
            <th><?php echo $this->team->getName(); ?></th>
        </tr>
        <?php foreach ($items["player"] AS $item) : ?>
        <tr class="row0">
            <td>
                <img src="<?php echo $item["image"]; ?>" />&nbsp;
                <a href="<?php echo $item["link"]; ?>"><b><?php echo $item["title"]; ?></b></a>
            </td>
        </tr>
        <?php endforeach ?>
    </table>
    <br />
<?php endif ?>

<table width="100%" class="adminform">
    <tr>
        <th>Setups</th>
    </tr>
    <?php foreach ($items["setup"] AS $item) : ?>
    <tr class="row0">
        <td>
            <img src="<?php echo $item["image"]; ?>" />&nbsp;
            <a href="<?php echo $item["link"]; ?>"><b><?php echo $item["title"]; ?></b></a>
        </td>
    </tr>
    <?php endforeach ?>
</table>
<br/>

<?php
    $left = ob_get_contents();
    ob_end_clean();
?>

<table width="100%">
    <tr>
        <td width="15%" valign="top"><?php echo $left; ?></td>
        <td width="85%" valign="top"><?php include $this->loadTemplate($this->view); ?></td>
    </tr>
</table>

<script language="JavaScript" type="text/javascript" src="../includes/js/wz_tooltip.js"></script>